<!-- 数据上传列表 -->
<template>
<div class="data-list-wp">
  <el-form ref="form" :inline="true" :model="form" size="small" class="this-form">
    <el-form-item label="选择日期：">
      <el-date-picker
        v-model="form.time"
        type="daterange"
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        :clearable="false">
      </el-date-picker>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="search">查询</el-button>
      <el-button @click="backRouter">导出</el-button>
    </el-form-item>
  </el-form>

  <div class="upload-total">上传数据量：1231231条</div>

  <div class="tab-list">
    <div v-for="(item, index) in tabList" :key="index" class="item"
      :class="{active: tabIdx == index}"
      @click="setTabIdx(item, index)">
      <div class="btn">
        <i class="icon iconfont"
        :class="[item.icon]"></i>
        <span class="c-m-r-20">{{item.label}}</span>
        <span>{{item.value}}条</span>
      </div>
      <div class="text-show">
        <div>上传数据量：9884521条</div>
        <div>上传表数量：32张 &nbsp;&nbsp;&nbsp;&nbsp; (规范要求表数量：32张)</div>
      </div>
    </div>
  </div>

  <el-table :data="table.data[tabIdx]"
    border
    :header-cell-style="{
      background: '#F2F2F2'
    }">
    <el-table-column v-for="(item, index) in table.head" :key="index"
      :prop="item.key"
      :label="item.label"
      align="center">
    </el-table-column>
  </el-table>


</div>
</template>
<script>
export default {
  name: 'data-list',
  data () {
    return {
      form: {
        time: ['', '']
      },

      tabIdx: 0,
      tabList: [
        {label: '电子病历', value: '12312', icon: 'icon-jiankangdangan1'},
        {label: '健康档案', value: '34435', icon: 'icon-jiankangdangan'},
        {label: '医改监测', value: '56233', icon: 'icon-shuji2', click: false},
      ],

      table: {
        head: [
          {label: '大类', key: 'a'},
          {label: '表名', key: 'b'},
          {label: '数据量', key: 'c'},
        ],
        data: [
          [
            {a: 'EMR01病历概要', b: 'emr01_WSSJ卫生事件摘要', c: '2000条'},
            {a: '', b: 'emr01_JBJK基本健康信息', c: '2000条'},
            {a: 'EMR02门（急）诊病历', b: 'emr02门（急）诊病历（主表）', c: '2000条'},
            {a: '', b: 'emr02YZ门（急）诊病历-医嘱（子表）', c: '2000条'},
            {a: '', b: 'emr02JC门（急）诊病历检查（子表）', c: '2000条'},
            {a: 'EMR03急诊留观病历', b: 'EMR03急诊留观病历', c: '2000条'},
            {a: 'EMR04门（急）诊西药处方', b: 'emr04门（急）诊西药处方（主表）', c: '2000条'},
            {a: '', b: 'emr04_YP门（急）诊处方西药（子表）', c: '2000条'},
          ],
          [
            {a: '个人基本健康信息登记', b: 'T_HR_A010101个人健康档案', c: '2000条'},
            {a: '成人健康体检', b: 'T_HR_B050101成人健康体检', c: '2000条'},
            {a: '健康教育', b: 'T_HR_A010201健康教育', c: '2000条'},
          ]
        ]
      }

    }
  },
  mounted () {

  },
  methods: {
    search () {

    },

    backRouter () {
      this.$router.back();
    },

    setTabIdx (item, index) {
      if (item.click !== false) {
        this.tabIdx = index;
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.data-list-wp {
  .this-form {
    padding: 0 0 32px;
  }
  .upload-total {
    padding-left: 50px;
    height: 34px;
    background: url(~@h/assets/image/up-total.png) no-repeat left center;
    line-height: 34px;
    font-size: 18px;
  }
  .tab-list {
    display: flex;
    margin: 50px 0 110px;
    .item {
      position: relative;
      .btn {
        display: flex;
        position: relative;
        align-items: center;
        margin-right: 20px;
        padding: 0 20px;
        width: 260px;
        height: 50px;
        background: #E4E4E4;
        border-radius: 10px;
        cursor: pointer;
        i {
          margin-right: 20px;
          font-size: 30px;
          color: #000;
        }
        &:after {
          content: '';
          display: none;
          position: absolute;
          top: 100%;
          left: 78px;
          width: 0;
          height: 0;
          border: 20px solid transparent;
          border-top-color: #199ED8;
        }
      }
      .text-show {
        display: none;
        position: absolute;
        top: 80px;
        line-height: 30px;
        padding-left: 20px;
        white-space: nowrap;
      }
      &.active {
        .btn {
          background: #199ED8;
          color: #fff;
          i {
            color: #fff;
          }
          &:after {
            display: block;
          }
        }
        .text-show {
          display: block;
        }
      }
    }
  }

}
</style>